/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package daoBeans;

import java.io.FileInputStream;
import java.sql.*;
import java.util.Properties;

/**
 *
 * @author Camilo
 */
public class conexionMySql {
        
    private String url = "jdbc:mysql://mysql-SellBoost.jelastic.servint.net/sellbost";
    private String user = "root";
    private String password = "fiwSl3RpUK";
    
    //private String url = "jdbc:mysql://localhost/sellbost";
    //private String user = "root";
    //private String password = "";
    
    public Connection comenzarDb(){
        Connection link = null;
        try
        {
            Class.forName("org.gjt.mm.mysql.Driver");
            link = DriverManager.getConnection(this.url, this.user, this.password);
        }
        catch (Exception e)
        {
            System.out.println("error");
        }       
        return link;       
    }
        
        
        /*
        Connection link = null;
        Properties prop = new Properties();
        try
        {
            prop.load(new FileInputStream(System.getProperty("user.home") + "/mydb.cfg"));
            String host = prop.getProperty("host").toString();
            String username = prop.getProperty("username").toString();
            String password = prop.getProperty("password").toString();
            String driver = prop.getProperty("driver").toString();
            Class.forName(driver);
            link = DriverManager.getConnection(host, username, password);
        }
        catch (Exception e)
        {
            System.out.println("error");
        }       
        return link;       
        * 
        */
    
}